package project.parser.ast;

import project.environments.DynamicEnv;
import project.environments.StaticEnv;
import project.parser.ast.aux.Funcs;
import project.parser.ast.aux.Stats;

public class ProgAST implements Prog {

	private final Funcs funcs;
	private final Stats stats;

	public ProgAST(Funcs funcs, Stats stats) {
		this.funcs = funcs;
		this.stats = stats;
	}

	@Override
	public String toString() {
		return stats.toString();
	}

	@Override
	public void typecheck(StaticEnv senv) {
		funcs.typecheckList(senv);
		stats.typecheckList(senv);
	}

	@Override
	public void evaluate(DynamicEnv denv) {
		funcs.evaluateList(denv);
		stats.evaluateList(denv);
	}

}
